import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        String[][] a=new String[4][2];
        int[][] b=new  int[4][2];
        Scanner input=new Scanner(System.in);
        for (int i=1;i<=2;i++){
            System.out.print("请输入第"+i+"个学生的学号：");
            a[i-1][0]=input.next();
            System.out.print("请输入第"+i+"个学生的姓名：");
            a[i-1][1]=input.next();
            System.out.print("请输入第"+i+"个学生的第一门课的成绩：");
            b[i-1][0]=input.nextInt();
            System.out.print("请输入第"+i+"个学生的第二门科的成绩：");
            b[i-1][1]=input.nextInt();
        }
        College college1 = new College(a[0][0], a[0][1], b[0][0], b[0][1]);
        College college2 = new College(a[1][0], a[1][1], b[1][0], b[1][1]);
        System.out.println(college1 + " 总分为" + college1.totalScore());
        System.out.println(college2 + " 总分为" + college2.totalScore());
        System.out.println("总人数为=" + College.count);
    }
}

abstract class Student_1 {
    private String sID;
    private String sName;
    public static int count = 0;

    public Student_1(String sID, String sName) {
        this.sID = sID;
        this.sName = sName;
        count += 1;
    }

    public String getsID() {
        return sID;
    }

    public String getsName() {
        return sName;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sID='" + sID + '\'' +
                ", sName='" + sName + '\'' +
                '}';
    }

    public abstract int totalScore();
}

class College extends Student_1{
    private int score1;
    private int score2;

    public College(String sID, String sName, int score1, int score2) {
        super(sID, sName);
        this.score1 = score1;
        this.score2 = score2;
    }

    @Override
    public int totalScore() {
        return score1 + score2;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
